﻿# -*- coding:utf-8 -*-
#
# склад
#url(r'^alt/$', 'sklad.views.main.index_alt', name="index_alt"),

from django.conf.urls.defaults import *

#sklad.views.categories
urlpatterns = patterns('sklad.views.categories',
#    url(r'^category/(\d+)/colaps/$', 'collaps', name="category_collaps"),
#    url(r'^category/(\d+)/expand/$', 'expand', name="category_expand"),
    url(r'^category/add/$',          'create_root', name="category_root_create"),
    url(r'^category/(\d+)/add/$',    'create', name="category_create"),
    url(r'^category/(\d+)/edit/$',   'edit', name="category_edit"),
    url(r'^category/(\d+)/delete/$', 'delete', name="category_delete"),
    url(r'^category/(\d+)/$',        'view', name="category_view"),
)

#sklad.views.parts
urlpatterns += patterns('sklad.views.parts',     
    url(r'^part/(\d+)/$',       'detail', name="part_detail"),
    url(r'^part/add/$',         'create', name="part_create"),
    url(r'^part/edit/(\d+)/$',  'edit',   name="part_edit"),
    url(r'^part/delete/(\d+)/$','delete', name="part_delete"),
    
    url(r'^part/in/$','receipt', name="part_receipt"),
    url(r'^part/out/$','delivery', name="part_delivery"),
)    

#sklad.views.documents    
urlpatterns += patterns('sklad.views.documents',    
    url(r'^doc/all/$',                      'list_all', name="document_all"),
    url(r'^doc/open/$',                     'list_open', name="document_open"),
    url(r'^doc/receipt/part/(\d+)/$',       'receipt_add_part', name="receipt_add_part"),
    url(r'^doc/delivery/part/(\d+)/$',      'delivery_add_part', name="delivery_add_part"),
    url(r'^doc/(\d+)/property/$',           'detail', name="document_detail"),
    url(r'^doc/receipt/part/(\d+)/move/$',  'to_receipt', name="receipt_move_part"),
    url(r'^doc/delivery/part/(\d+)/move/$', 'to_delivery', name="delivery_move_part"),
    url(r'^doc/(\d+)/register/$',           'register', name="document_register"),
    url(r'^doc/(\d+)/delete/$',             'delete', name="document_delete"),
)    
    
#sklad.views.main
urlpatterns += patterns('sklad.views.main',
    url(r'^search/$','search', name="search"),
    url('^$', 'index', name="index"),
)     
   

